package iedcyt.acute.controller.listeners.menu;

import iedcyt.acute.model.MenuModel;
import iedcyt.acute.view.MainMenu;

public class MenuCommonListener {

	protected MenuModel _model;
	protected MainMenu _view;
	
	public MenuCommonListener(MenuModel _model, MainMenu _view) {
		this._model = _model;
		this._view = _view;
	}
	
	/**
	 * Obtiene el path necesario para el beans.xml
	 * @param value
	 * @param path
	 * @return
	 */
	protected String getPath(String value, String path) {

			if (value.contains("jdbc:sqlite:")) 
				value = "jdbc:sqlite:" + path.replace("\\", "\\\\");
			else if (value.contains("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="))
				value = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + path.replace("\\", "\\\\");

			return value;
		
	}
}
